package cn.e4j.core.shiro;

import lombok.Data;
import org.apache.shiro.authc.UsernamePasswordToken;

/**
 * 用户和密码（包含验证码）令牌类
 *
 * @author wenchuan.li
 * @version 2018/12/02 21:13
 */
@Data
public class UserPasswordToken extends UsernamePasswordToken {

    private static final long serialVersionUID = 1L;

    private String captcha;
    private boolean mobileLogin;
    private String lang_;
    private String dbc_;//对应企业编号
    private String site_;//对应营运据点

    public UserPasswordToken() {
        super();
    }

    public UserPasswordToken(String username, String password, boolean mobileLogin, String lang_) {
        super(username, (char[]) (password != null ? password.toCharArray() : null),
                false, (String) null);
        this.mobileLogin = mobileLogin;
        this.lang_ = lang_;
    }

    public UserPasswordToken(String username, char[] password,
                             boolean rememberMe, String host, String captcha, boolean mobileLogin,
                             String lang_, String dbc_, String site_) {
        super(username, password, rememberMe, host);
        this.captcha = captcha;
        this.mobileLogin = mobileLogin;
        this.lang_ = lang_;
        this.dbc_ = dbc_;
        this.site_ = site_;
    }

}